from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtPrintSupport import *

class EngineAdapter(QWidget):
    engine = None
    def __init__(self, parent, item):
        super(QWidget, self).__init__(parent)
        self.layout = QHBoxLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setContentsMargins(0, 0, 0, 0)

        self.engine = item
        self.layout.addWidget(item)

    def makeClose(self):
        if self.engine is not None:
            self.engine.closeEngine()